package lombok;

import lombok.extern.slf4j.Slf4j;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

@Slf4j
public class DemoLombok {

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @ToString
    static class Person {
        private String name;
    }


    public static void main(String[] args) {
        log.info("name is:{}", "Ashe");
        logTest();
        exception();
    }

    private static void logTest() {
        log.info("msg");
    }


    @SneakyThrows
    private static void exception() {
        throw new Throwable();
    }

    @SneakyThrows
    private static void stream(String[] args) {
        @Cleanup InputStream in = new FileInputStream(args[0]);
        @Cleanup OutputStream out = new FileOutputStream(args[1]);
        byte[] b = new byte[10000];
        while (true) {
            int r = in.read(b);
            if (r == -1) break;
            out.write(b, 0, r);
        }
    }


}
